﻿Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Navigation

Partial Public Class LoginPage
    Inherits Page

    Private ReadOnly _viewModel As LoginPageViewModel

    Public Sub New()
        Me.InitializeComponent()

        ' Enter construction logic here...
        'Me.DataContext = viewModel
        _viewModel = New LoginPageViewModel()
        Me.DataContext = _viewModel
    End Sub

    Protected Overloads Sub OnNavigatedTo(ByVal e As NavigationEventArgs)
        'Console.WriteLine("Param: " + Me.NavigationContext.QueryString("AfterRegistrationUserId").ToString())
        'Dim uid As String = Me.NavigationContext.QueryString("AfterRegistrationUserId").ToString()
        'If uid IsNot Nothing Then
        '    _viewModel.ErrorMessage = "注册成功，用户 ID 为：" & uid
        'End If
        '清除已有的登录信息
        Application.Current.Resources.Remove("Token")
        Application.Current.Resources.Remove("UserId")
        Application.Current.Resources.Remove("UserName")
    End Sub

End Class